#include <iostream>
using namespace std;

int main()
{
	long long m = 0;
	int k = 0;
	cin >> m >> k;
	int i = 0;
	while (m)
	{
		if (m % 10 == 3)
			i++;
		m /= 10;
	}
	if (i == k)
		cout << "YES";
	else
		cout << "NO"; 
	return 0;
 } 
